package org.easy.core.exception;


import org.easy.core.enums.StateCodeEnum;

import java.util.List;


public class BizRuntimeException extends RuntimeException {

    private String msg;

    private int code = 500;

    private List<String> errStacks;


    public BizRuntimeException(String message) {
        super(message);
        this.msg = message;
    }

    public BizRuntimeException(StateCodeEnum message) {
        super(message.getMsg());
        this.code = message.getCode();
        this.msg = message.getMsg();
    }


    public BizRuntimeException(int code, String msg) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }


    public BizRuntimeException(int code, String msg, List<String> errStacks) {
        super(msg);
        this.msg = msg;
        this.code = code;
        this.errStacks = errStacks;
    }


    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public List<String> getErrStacks() {
        return errStacks;
    }
}
